<template>
	<view class="raffleList">
		<z-paging ref="paging" v-model="dataList" @query="queryList" :default-page-size="15">
			<template #loading>
				<uni-load-more status="loading"></uni-load-more>
			</template>
			<uni-list  border-full v-if="dataList.length">			
				<uni-list-item clickable @click="routerTo('/pages_raffle/detail/detail')" showArrow  :title="item.id+'-'+item.title" 
				:note="`列表${Date.now()}描述信息\n已参与:10人`" rightText="右侧文字" v-for="item in dataList" 
				:key="item.id"/>
				
			</uni-list>
		</z-paging>
		
		<uni-fab ref="fab" :pattern="{icon:'plusempty'}" :content="content" horizontal="right" vertical="bottom"
		@fabClick="addRaffle" />
	</view>
</template>

<script setup>
import { ref } from 'vue';
import { routerTo } from '../../utils/common';


	
const paging = ref(null);
const dataList = ref([]);

const queryList = (pageNo, pageSize)=>{
	console.log(pageNo, pageSize);
	let data=[]
	setTimeout(()=>{
		for(let i = 0; i<pageSize; i++){
			let item = {
				id:i,
				title:Math.random()
			}
			data.push(item)
		}
		paging.value.complete(data);
	},1000)
}

const addRaffle = ()=>{	
	routerTo("/pages_raffle/edit/edit")
}


</script>

<style lang="scss" scoped>

</style>
